$(document).ready(function() {
    //保存当前的标记数据
    var username = $("#auditname").html();//获取当前的用户名字
    var name1,name2,name3,name4;
    $.ajax({
        type: "post",
        async: false,
        contentType: "utf-8",
        url: "UserDataQuery.action?username=" + username,
        success: function (result) {
            var MonitArr1 = result.split(':');
            for(var i = 0;i < MonitArr1.length;i++)
            {
                name1=MonitArr1[i];
                $.ajax({
                    type: "get",
                    async:false,
                    url: "DataAudit.action?aname="+name1,
                    contentType:'application/x-www-form-urlencoded; charset=utf-8',
                    success: function (result) {
                        if (result == "error") {
                        }
                        else {
                            var MonitAr = result.split(',');
                            for (var j = 0; j < MonitAr.length; j++) {
                                name2=MonitAr[j];
                                $.ajax({
                                    type: "get",
                                    async:false,
                                    url: "SecAudit.action?secname=" + name2,
                                    success: function (result) {
                                        if (result == "00") {

                                        } else if (result == "error") {
                                            $("#adtable").append(
                                                "<tr>" + "<td>" + name2 + "</td>" +"<td>无</td>"
                                                +"<td>"+ name1 +"</td>"
                                                +"<td><button class='update btn-primary sumbit'>通过审核</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class='update btn-primary sumbit'>返回修改</button></td>"
                                                +"<td><label>同意     </label><input ype=\"radio\" name="+name2+"1"+ "value=\"1\" id=" + name2+"1"+"><label>  不同意</label><input type = \"radio\" name ="+name2+"2"+" value=\"2\" id=" + name2+"1"+"></td>"
                                                + "</tr>"
                                            );
                                            alert(name2+"1");
                                        } else {
                                            var MonitA = result.split(',');
                                                for (var ix = 0; ix < MonitA.length; ix++) {
                                                    $.ajax({
                                                        type: "get",
                                                        url: "SecAuditdata.action?secname=" + MonitA[ix],
                                                        async:false,
                                                        success: function (result) {
                                                            var MonitArrCon = result.split(',');
                                                            $("#adtable").append(
                                                                "<tr>" + "<td>" + MonitAr[j] + "</td>" +"<td>"+ MonitArrCon[3]+"</td>"
                                                                +"<td>"+ MonitArr1[i] +"</td>"
                                                                +"<td><button class='update btn-primary sumbit'>通过审核</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class='update btn-primary sumbit'>返回修改</button></td>"
                                                                + "</tr>"
                                                            );
                                                        }
                                                    });
                                                }

                                        }
                                    }
                                });
                            }
                        }
                    }
                });
            }
        }
    });
});